package org.mc.sbd.mock.api;

import lombok.extern.slf4j.Slf4j;
import org.mc.sbd.mock.application.UserLoginApplicationService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("mock")
@Slf4j
public class UserMobilePhoneLoginController {
    @Resource
    private UserLoginApplicationService userLoginApplicationService;

    @PostMapping("user/login/by-mobile-phone")
    public String loginByMobilePhone(@RequestBody @Validated UserMobilePhoneLoginDto dto) {
        return userLoginApplicationService.loginByMobilePhone(dto.getMobilePhoneNo(), dto.getCaptchaCode());
    }
}